Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: Add a CacheF() function to control completion cache refresh #887

Closed
wants to merge 1 commit into from

Conversation

maxlandon
Copy link
Contributor

No description provided.

@rsteube
Copy link
Member

rsteube commented Aug 8, 2023

Need to give this some thinking when i got the time. I feel like this should already be doable with the timeout (e.g. zero duration) and key arguments.
If anything i'd probably opt for a custom error returned by the key function 🤔 .

@maxlandon
Copy link
Contributor Author

maxlandon commented Aug 8, 2023

You might very well be right, and its probable that I've come to open this PR just because I over complicated my own use of the cache in some instances.

So feel free to close if in a few days you still have no clues on this, as it might just be me trying to solve a non-existing problem.

@maxlandon
Copy link
Contributor Author

Two other things:
1 - I saw you started leveraging lexers for command-line consumption, great idea, curious to see what wonders you'll do with this.
2 - I tried to attack this infamous cobra global comp map, here: spf13/cobra#2012 (comment), if you have anything you'd like to contribute in order to pull this chard out of everyone's foot, that will be my joy !

@rsteube
Copy link
Member

rsteube commented Aug 9, 2023

Yes, zero timeout duration seems to do the trick.
Writing a lexer is actually something i wanted to avoid, but it is needed for Split.

@rsteube rsteube closed this in #891 Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants